package com.nuaa.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.nuaa.dao.change.inter.ProductDaoInter;
import com.nuaa.domain.change.ProductEntity;
import com.nuaa.service.inter.ProductService;
import com.nuaa.utils.DataGrid;
import com.nuaa.utils.PageInfo;

@Service("productService")
public class ProductServiceImpl implements ProductService{

	@Resource
	private ProductDaoInter productDao;
	@Override
	public DataGrid<ProductEntity> getByOrderNo(String orderNo, PageInfo pager) {
		long totalNum = productDao.countbyOrderNo(orderNo);
		int[] fm = pager.getFirstindexAndMaxindex();
		List<ProductEntity> list = productDao.selectByOrderNo(orderNo, fm[0], fm[1]);
		return new DataGrid<ProductEntity>(totalNum, list);
	}
	
}
